package com.kaigejava.factorypattern.absFactory;

import com.kaigejava.factorypattern.method.PizzaAbstract;
import com.kaigejava.factorypattern.method.domain.ShangHaiGreekPizza;
import com.kaigejava.factorypattern.method.domain.ShangHaiPepperPizza;

/**
 * Created by kaigejava on 2019/8/27.
 * 上海的披萨工厂
 */
public class ShangHaiFactory implements IFactoryInterface {
    @Override
    public PizzaAbstract CreatePizza(String ordertype) {
        PizzaAbstract pizza = null;

        if (ordertype.equals("greek")) {
            pizza = new ShangHaiGreekPizza();
        } else if (ordertype.equals("pepper")) {
            pizza = new ShangHaiPepperPizza();
        }
        return pizza;
    }
}
